<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
    <title>全部借阅管理员</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <script src="js/jquery-3.2.1.js"></script>
    <script src="js/bootstrap.min.js" ></script>
    <script>
        $(function () {
            $('#header').load('admin_header.html');
        })

        function del() {
            if(confirm("确实要删除该借阅管理员吗？")){
                alert("已经删除！");
            }else {
                window.event.returnValue = false;
                alert("已经取消了删除操作");
            }
        }
    </script>
</head>
<body background="img/u1.jpg" style=" background-repeat:no-repeat ;
background-size:100% 100%;
background-attachment: fixed;">
<div id="header"></div>
<c:if test="${!empty info}">
    <script>alert("${info}");window.location.href="allBorrowAdmin.html"</script>
</c:if>

<div style="position: relative;top: 15%">
    <c:if test="${!empty succ}">
        <div class="alert alert-success alert-dismissable">
            <button type="button" class="close" data-dismiss="alert"
                    aria-hidden="true">
                &times;
            </button>
                ${succ}
        </div>
    </c:if>
    <c:if test="${!empty error}">
        <div class="alert alert-danger alert-dismissable">
            <button type="button" class="close" data-dismiss="alert"
                    aria-hidden="true">
                &times;
            </button>
                ${error}
        </div>
    </c:if>
</div>


<div class="panel panel-default" style="position:relative;top: 80px;width: 90%;margin-left: 5%">
    <div class="panel-heading">
        <h3 class="panel-title">
            全部借阅管理员
        </h3>
    </div>
    <div class="panel-body">
        <table class="table table-hover" >
            <thead>
            <tr>
                <th>账号</th>
                <th>密码</th>
                <th>用户名</th>
                <th>权限</th>
                <th>修改权限</th>
                <th>编辑</th>
                <th>删除</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${borrowAdmins}" var="borrowAdmin">
                <tr>
                    <td>${borrowAdmin.adminId}</td>
                    <td>${borrowAdmin.password}</td>
                    <td>${borrowAdmin.username}</td>
                    <c:if test="${borrowAdmin.power == 1}">
                        <td>管理员</td>
                    </c:if>
                    <c:if test="${borrowAdmin.power == 2}">
                        <td>借阅管理员</td>
                    </c:if>
                    <td><a href="changPower.html?adminId=${borrowAdmin.adminId}&power=${borrowAdmin.power}"><button type="button" class="btn btn-succ btn-xs">变更</button></a></td>
                    <td><a href="admin_borrow_edit.html?adminId=${borrowAdmin.adminId}"><button type="button" class="btn btn-info btn-xs">编辑</button></a></td>
                    <td><a href="admin_borrow_delete.html?adminId=${borrowAdmin.adminId}" onclick="return del()"><button type="button" class="btn btn-danger btn-xs">删除</button></a></td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>

<%--查看  借阅管理员吗全部信息--%>
